﻿namespace TC
{
    public class BoolConvert : VariableNode
    {
        public ValueInput<bool> valueIn;
        public ValueOutput<int> intOut;
        public ValueOutput<double> doubleOut;
        public ValueOutput<float> floatOut;
        public ValueOutput<string> stringOut;

        public override void OnCreate()
        {
            base.OnCreate();

            valueIn = this.AddValueInPort<bool>("valueIn");
            intOut = this.AddValueOutPort<int>("intOut", () => { return valueIn.Value ? 1 : 0; });
            doubleOut = this.AddValueOutPort<double>("doubleOut", () => { return valueIn.Value ? 1 : 0; });
            floatOut = this.AddValueOutPort<float>("floatOut", () => { return valueIn.Value ? 1 : 0; });
            stringOut = this.AddValueOutPort<string>("stringOut", () => { return valueIn.Value.ToString(); });
        }
    }
}
